#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rev(i,a,b) for(int i=a;i>=b;i--)
#define Fin(file) freopen(file,"r",stdin)
#define Fout(file) freopen(file,"w",stdout)
using namespace std; using ll = long long;
constexpr int N=1e6+5;
int read(){
    char Charlie; while(!isdigit(Charlie=getchar())) ;
    int Y=Charlie-'0'; while(isdigit(Charlie=getchar())) Y=Y*10+Charlie-'0';
    return Y;
}
struct Bowl { double h,r,R; } O[N];
double dist(const Bowl& A,const Bowl& B){ // A put on top of B, the distance between the bottoms
    if(A.r>B.R) return B.h;
    double Ak=A.h/(A.R-A.r), Bk=B.h/(B.R-B.r);
    if(Ak<Bk){
        if(A.R>B.R) return max(0.0,B.h-(B.R-A.r)*Ak);
        else return max(0.0,(A.R-B.r)*Bk-A.h);
    }
    else{
        if(A.r<B.r) return 0;
        else return (A.r-B.r)*Bk;
    }
}
int n,tp; Bowl st[N]; double pos[N];
int main(){
    Fin("wan.in"); Fout("wan.out");
    n=read();
    For(_,1,n){
        Bowl A; A.h=read(); A.r=read(); A.R=read(); if(_==1) { st[++tp]=A; pos[tp]=0; continue; }
        while(true){
            assert(tp);
            double t=pos[tp]+dist(A,st[tp]);
            if(t+A.h<pos[tp]+st[tp].h) { st[++tp]=A; pos[tp]=t; break; }
            int ok=1; tp--;
            while(tp){
                if(t-pos[tp]<dist(A,st[tp])) { ok=0; break; }
                if(t+A.h<pos[tp]+st[tp].h) break;
                tp--;
            }
            if(ok) { st[++tp]=A; pos[tp]=t; break; }
        }
        For(i,2,tp) assert(pos[i]>=pos[i-1]&&pos[i]+st[i].h<=pos[i-1]+st[i-1].h);
    }
    cout<<setprecision(10)<<fixed<<pos[1]+st[1].h<<'\n';
    return 0;
}